﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations.Schema;

namespace S4Store.Domain.CarKpi
{
    public class CarModelMonthConfig 
    {
        public int Id { get; set; }

        /// <summary>
        /// 是否确认
        /// </summary>
        public bool IsConfirmed { get; set; }
        /// <summary>
        /// 月
        /// </summary>
        public DateTime Month { get; set; }

        public int StoreId { get; set; }

        public int CarModelId { get; set; }

        /// <summary>
        /// 计划提车
        /// </summary>
        public int JHTC { get; set; }

        /// <summary>
        /// 销售目标
        /// </summary>
        public int SaleTarget { get; set; }

        /// <summary>
        /// 月初库存
        /// </summary>
        public int LastMonthInventory { get; set; }

        /// <summary>
        /// 上月交车
        /// </summary>
        public int LastMonthGive { get; set; }

        /// <summary>
        /// 上月未交
        /// </summary>
        public int LastMonthNotGive { get; set; }

        /// <summary>
        /// 是否标配车型
        /// </summary>
        public bool IsStandardEquipped { get; set; }

        /// <summary>
        /// 是否上旬套餐版本
        /// </summary>
        public bool IsLstTenVersion { get; set; }
        /// <summary>
        /// 是否中旬套餐版本
        /// </summary>
        public bool IsMidTenVersion { get; set; }
        /// <summary>
        /// 是否下旬套餐版本
        /// </summary>
        public bool IsLastTenVersion { get; set; }

        public virtual CarModel CarModel { get; set; }
        public virtual Store Store { get; set; }

        [NotMapped]
        public bool Enble { get; set; }

        /// <summary>
        /// 套餐车型数
        /// </summary>
        [NotMapped]
        public virtual int PackageCarModelCount
        {
            get
            {
                int count=0;
                if (IsLstTenVersion) count += 1;
                if (IsMidTenVersion) count += 1;
                if (IsLastTenVersion) count += 1;
                return count;
            }
        }
    }
}
